CreateMasterSlaveServerGroup
Description
call CreateMasterSlaveServerGroup to create a primary and standby server group. A primary and standby server group can only contain two ECS instances, one is the primary server and the other is the standby server.
Request Method
POST
Request Path
/apsara/route/Slb/CreateMasterSlaveServerGroup
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
LoadBalancerId | BODY | string | Yes | lb-bp1hv944r69al4j**** | load balancing instance ID. |
RegionId | BODY | string | Yes | cn-qingdao-env17-d01 | the region ID of the load balancing instance. |
MasterSlaveServerGroupName | BODY | string | No | sg-atstuj3rtopty**** | primary and standby virtual server group name. |
MasterSlaveBackendServers | BODY | string | No | [{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","ServerType":"Master","Description":"test-112" }, { "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","ServerType":"Slave","Description":"test-112" }] | list of primary and standby server groups. Value: is a Json string, and its structure is a JsonList. In a request, the list supports up to 20 elements. ServerId:String type, required, backend server instance ID. Port:Integer type, required, port used by backend server, value range:1~65535. Weight:Integer type, required, weight of backend server, value range:0~100. Description :String type, optional, backend server description, 1-80 characters in length, allow letters, numbers, dashes (-), forward slashes (/), half-width periods (.), and underscores (_). Support Chinese. ServerType:String type, indicating the primary and standby type of the backend server, value: Master: main server. Slave: standby server. Type:String type, indicating the instance type of the backend server, value: ecs(default):ECS instance. eni: ENI instance. ServerIp: instance IP of ECS or ENI. A primary and standby server group can contain up to 2 backend servers. if this parameter is not specified, create an empty list of primary and standby server groups. The example is as follows: mount ECS:[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port": "80", "ServerType": "Master", "Description": "test-112" }, { "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port": "80", "ServerType": "Slave", "Description": "test-112" }] mount ENI:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "Port": "80", "ServerType": "Master", "Description": "test-112" }, { "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "ServerType": "Slave", "Description": "test-112" }] mount ENI multi-IP:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "ServerType": "Master", "Description": "test-112" }, { "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "ServerType": "Slave", "Description": "test-112" }] |
version | BODY | string | No | 2016-01-01 | version of api |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
RequestID | string | 1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC | Request id |
Example
Successful Response example
{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}
title: CreateVServerGroup
sidebar_position: 3
CreateVServerGroup
Description
call CreateVServerGroup to add a backend server group and add a backend server to the specified backend server group.
Request Method
POST
Request Path
/apsara/route/Slb/CreateVServerGroup
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
VServerGroupName | BODY | string | No | Group1 | virtual server group name. is limited to 1 to 80 characters in length. Only Chinese characters, letters, numbers, dashes (-), forward slashes (/), periods (.), and underscores (_) are allowed. |
LoadBalancerId | BODY | string | Yes | lb-bp1qjwo61pqz3ahl**** | load balancing instance ID. |
RegionId | BODY | string | Yes | cn-qingdao-env17-d01 | load balancing region ID. |
BackendServers | BODY | string | No | [{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.XX.XX. 6", "Port":"80","Description":"test-112" }, { "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.XX.XX. 6", "Port":"80","Description":"test-112" }] | list of back-end servers to be added. Value: is a Json string, and its structure is a JsonList. In a request, the maximum number of elements in the List is 20. ServerId:String type, required, backend server instance ID, ECS instance ID or ENI instance ID. Port:Integer type, required, port used by backend server, value range:1~65535. Weight:Integer type, required, weight of backend server, value range:0~100. Description :String type, optional, backend server description, 1-80 characters in length, allow letters, numbers, dashes (-), forward slashes (/), English periods (.), and underscores (_). Chinese is supported. Type:String type, required, indicating the instance type of the backend server, value: ecs(default):ECS instance. eni: ENI instance. ServerIp: instance IP of ECS or ENI. The example is as follows: example of mounting ECS:[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port": "80", "Description": "test-112" }] mount ENI:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "Description": "test-112" }] mount ENI multi-IP:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "Description": "test-112" },{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "172.166.**.**", "Port": "80", "Description": "test-113" }] |
version | BODY | string | No | 2016-01-01 | version of api |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
VServerGroupId | string | rsp-cige6**** | backend server group ID. |
ServerType | string | ECS | No description for this parameter. |
Type | string | Type | backend server type, value: ecs(default):ECS instance. eni: ENI instance. |
ServerId | string | vm-2**** | ECS instance ID or ENI instance ID. |
Description | string | backend server group | backend server group description. |
RequestId | string | 9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C | request ID. |
BackendServer | No sample value for this parameter. | No description for this parameter. | |
Port | integer | 70 | the port used by the backend server. |
BackendServers | array of backendserver | No sample value for this parameter. | backend server list. |
Weight | integer | 100 | the weight of the back-end server. |
Example
Successful Response example
{
"VServerGroupId":"rsp-cige6****",
"ServerType":"ECS",
"Type":"Type",
"ServerId":"vm-2****",
"Description":"backend server group",
"RequestId":"9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
"BackendServer":"",
"Port":"70",
"BackendServers":"",
"Weight":"100"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}